<template>
  <div class="px-6 py-9">
    <FormTitle text="客户信息">
      <!-- <a-button type="primary">保存</a-button> -->
      <!-- <a-button v-if="isUpdate" @click="handleSumbit" type="primary">保存</a-button>
      <a-button v-else @click="handleEdit">编辑</a-button> -->
    </FormTitle>
    <div class="content mt-3">
      <a-descriptions :column="3">
        <a-descriptions-item label="客户名称"> 付小小 </a-descriptions-item>
        <a-descriptions-item label="项目联系人"> XX 32943898021309809423 </a-descriptions-item>
        <a-descriptions-item label="手机号码"> 3321944288191034921 </a-descriptions-item>
      </a-descriptions>
    </div>
    <FormTitle text="项目信息" />
    <div class="content mt-3">
      <a-descriptions :column="3">
        <a-descriptions-item label="项目名称"> 付小小 </a-descriptions-item>
        <a-descriptions-item label="项目类型"> XX 32943898021309809423 </a-descriptions-item>
        <a-descriptions-item label="项目施工地"> 3321944288191034921 </a-descriptions-item>
        <a-descriptions-item label="项目承建方"> 3321944288191034921 </a-descriptions-item>
        <a-descriptions-item label="计划开工时间"> 付小小 </a-descriptions-item>
        <a-descriptions-item label="计划竣工时间"> XX 32943898021309809423 </a-descriptions-item>
        <a-descriptions-item label="验收时间"> 3321944288191034921 </a-descriptions-item>
        <a-descriptions-item label="竣工时间"> 3321944288191034921 </a-descriptions-item>
        <a-descriptions-item label="承建负责人"> 付小小 </a-descriptions-item>
        <a-descriptions-item label="现场管理员"> XX 32943898021309809423 </a-descriptions-item>
        <a-descriptions-item label="施工队"> 3321944288191034921 </a-descriptions-item>
        <a-descriptions-item label="施工队长"> 3321944288191034921 </a-descriptions-item>
        <a-descriptions-item label="设计人员"> 付小小 </a-descriptions-item>
        <a-descriptions-item label="预算人员"> XX 32943898021309809423 </a-descriptions-item>
        <a-descriptions-item label="市场人员"> 3321944288191034921 </a-descriptions-item>
        <a-descriptions-item label="项目合同金额"> 3321944288191034921 </a-descriptions-item>
        <a-descriptions-item label="项目预算金额"> 3321944288191034921 </a-descriptions-item>
      </a-descriptions>
      <a-descriptions :column="1">
        <a-descriptions-item label="项目简介"> 3321944288191034921 </a-descriptions-item>
      </a-descriptions>
    </div>
  </div>
</template>
<script lang="ts">
  import { Descriptions } from 'ant-design-vue';
  import { defineComponent } from 'vue';
  // import { PageWrapper } from '/@/components/Page';
  // import { HTabs } from '/@/components/HTabs';
  import FormTitle from '../components/FormTitle.vue';
  // import { BasicForm } from '/@/components/Form/index';
  // import { useMessage } from '/@/hooks/web/useMessage';
  // import { useDesign } from '/@/hooks/web/useDesign';
  // import { columns, EmailFormSchema, DDFormSchema, SMSFormSchema } from './config.data';
  // import {
  //   getConfigByKeyApi,
  //   saveThirdPartyConfigApi,
  //   saveSmsConfigApi,
  //   saveFilerServerConfigApi,
  //   saveEmailConfigApi,
  //   saveDingConfigApi,
  // } from '/@/api/admin/tenant';

  // /sysTenantConfig/getByKey/{key}
  // const isUpdate = ref(false);
  // // import { BasicImport } from '/@/components/ImportButton';

  // const api = {
  //   TENANT_EMAIL_CONFIG: saveEmailConfigApi, // 邮件
  //   TENANT_DINGTALK_MSG_CONFIG: saveDingConfigApi, // 钉钉
  //   TENANT_SMS_CONFIG: saveSmsConfigApi, // 短信
  //   TENANT_WECHAT_CONFIG: () => {}, // 微信
  //   TENANT_THIRD_PARTY_CONFIG: saveThirdPartyConfigApi, // 第三方
  //   TENANT_FILE_SERVER_CONFIG: saveFilerServerConfigApi, // 文件服务
  // };
  export default defineComponent({
    name: 'BasicProjectInfo',
    components: {
      FormTitle,
      [Descriptions.name]: Descriptions,
      [Descriptions.Item.name]: Descriptions.Item,
    },
    setup() {
      // const { prefixCls } = useDesign('tenant-config1');
      // const { createMessage } = useMessage();
      // // const formSchema
      // const type = ref(columns[0].value);
      // const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({
      //   labelWidth: 120,
      //   layout: 'vertical',
      //   disabled: true,
      //   baseColProps: { md: 11, lg: 6, span: 6, offset: 2, pull: 2 },
      //   schemas: EmailFormSchema,
      //   showActionButtonGroup: false,
      // });
      // const changeType = async ({ value }) => {
      //   type.value = value;
      //   isUpdate.value = false;
      //   setProps({ disabled: true });
      //   let schemas: any[] = [];
      //   switch (value) {
      //     case 'TENANT_EMAIL_CONFIG':
      //       schemas = EmailFormSchema;
      //       break;
      //     case 'TENANT_DINGTALK_MSG_CONFIG':
      //       schemas = DDFormSchema;
      //       break;
      //     case 'TENANT_SMS_CONFIG':
      //       schemas = SMSFormSchema;
      //       break;
      //     default:
      //       break;
      //   }
      //   // resetSchema(schema);
      //   setProps({ schemas });
      //   await init(value);
      // };
      // onMounted(() => {
      //   changeType(columns[0]);
      // });
      // async function init(value) {
      //   resetFields();
      //   const ret = await await getConfigByKeyApi(value);
      //   setFieldsValue(ret);
      // }
      // async function handleSumbit() {
      //   const params = await validate();
      //   console.log(
      //     '%cparams===>72： ',
      //     'background: rgb(23, 197, 237,.6); color: #ff5023; font-size:18px;font-weight:700',
      //     params,
      //   );
      //   await api[type.value](params);
      //   createMessage.success('操作成功');
      //   isUpdate.value = false;
      //   setProps({ disabled: true });
      // }
      // const handleEdit = () => {
      //   isUpdate.value = true;
      //   setProps({ disabled: false });
      // };
      // return {
      //   type,
      //   columns,
      //   prefixCls,
      //   registerForm,
      //   changeType,
      //   handleSumbit,
      //   isUpdate,
      //   handleEdit,
      // };
    },
  });
</script>

<style lang="less">
  @prefix-cls: ~'@{namespace}-tenant-config';

  .@{prefix-cls} {
    // background-color: @background-color-light;
    .vben-basic-form {
      &[disabled='true'] {
        .ant-form-item-label {
          label {
            color: @text-color-call-out;
          }
        }
      }

      .ant-input-number-disabled,
      .ant-input-affix-wrapper-disabled {
        background-color: transparent;
        color: #333;

        > .ant-input[disabled] {
          color: #333;
        }
      }
    }
  }
</style>
